package com.itjiange.reglg.common;

import lombok.Getter;

/**
 * Redis
 *
 * @author ItJiange
 * @date 2023/11/17
 */
@Getter
public enum RedisCode {
    /**
     * 60 秒后恢复
     */
    FLUSH_PORT("ipkey", 60),
    BLACK_IP("black", 86400);

    private String prefix;
    private int timeOut;

    RedisCode(String prefix, int timeOut) {
        this.prefix = prefix;
        this.timeOut = timeOut;
    }

    /**
     * 拼接 key
     *
     * @return
     */
    public String join(String... keys) {
        StringBuffer sb = new StringBuffer();
        for (String key : keys) {
            sb.append(key);
        }
        return sb.toString();
    }
}
